<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:include href="menu.xsl" />
<xsl:include href="footer.xsl" />
<xsl:output doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" method="xml" encoding="iso-8859-1" />
  <xsl:template match="/">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr">
  <head>
  <title>Framework Inovia</title>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<link rel="stylesheet" href="public/manager/css/manager.css" type="text/css" media="screen" />  
	 <script src="public/manager/js/maintenance.js" type="text/javascript" language="javascript"></script>
  	<script type="text/javascript" src="public/manager/js/menu.js"></script>
  </head>
  <body>
    <div id="header">
    	<img id="logo" src="public/manager/images/bando.png" alt="Fw-BofF" />  
    </div>
    <div id="date">
      <xsl:value-of select=".//site/date" />
    </div>
    
    <!--<ul id="menu">
    	<li><a href="index.php?action=homeManager">Home</a></li>
    	<li><a class="active" href="index.php?action=homeMaintenance">Maintenance</a></li>
    	<li><a href="index.php?action=homeUsers">Users</a></li>
    	<li><a href="index.php?action=homeMonitoring">Monitoring</a></li>
    	<li><a href="index.php?action=homeScaffolding">Scaffolding</a></li>
    	<li><a  href="index.php?action=homeUpdates">Updates</a></li>
    </ul>-->
    
    <xsl:call-template name="displayMenu">
      <xsl:with-param name="selectedMenu" select="string('maintenance')"/>
    </xsl:call-template>
    
    <div id="PageLeft">
    
      <div id="menutaches">
        <h2>Actions</h2>
        <p> 
          <a href="index.php?action=switchMaintenance">
    				<xsl:choose>
    					<xsl:when test=".//site/maintenance/state/text() = '0'">Activate</xsl:when>
    					<xsl:otherwise>Desactivate</xsl:otherwise>
    				</xsl:choose> maintenance
          </a> 
        </p>
      </div>
      
      
      <div id="content" style="width:550px;">
        <h1 id="pageName" style="width:600px;margin-top:20px">   Maintenance   </h1>
        
        
    		<xsl:variable name="nbError" select="count(//error)" />
        <xsl:if test="$nbError!=0">
    		  <p>
    		  <xsl:for-each select=".//error">
        		  <span class="important"><xsl:value-of select="text" /></span><br/>
          </xsl:for-each>  
          </p>
    		 </xsl:if>
        
        <div style="margin:10px 0 0 20px;width:580px;padding:0px;border:1px dotted #AAAAAA;background-color:#ECF3E1;">
        
        <form action="index.php?action=editMaintenanceAll" name="actionsForm">
          <input type="hidden" name="action" value="editMaintenanceAll"/>
        <div style="position:relative;width:280px;left:285px">
          <a href="" onclick="if (markAllRows('actionsForm',1)) return false;">select all</a>
            - 
           <a href="" onclick="if (markAllRows('actionsForm',0)) return false;">unselect all</a>
            - 
          <select name="maintenance" onchange="this.form.submit();">
            <option value="enable" >For the selection :</option>
            <option value="enable" >Enable</option>
            <option value="disable" >Disable</option>
          </select>
        </div>
        
        <table style="width:550px;padding:0px;spacing:0px;border:0px;">
          <tr class="tableheader">
            <td>Action</td>
            <td>Groups</td>
            <td>Output</td>
            <td width="16" colspan="2"></td>
          </tr>
          <xsl:for-each select=".//site/actions/action">
            <xsl:variable name="ismaintenance" select="maint" />
            <xsl:variable name="name" select="name" />
            <tr>
              <td><xsl:value-of select="name"/></td>
              <td><xsl:value-of select="groups"/></td>
              <td><xsl:value-of select="output"/></td>
              <td>
                <xsl:choose>
                  <xsl:when test="$ismaintenance=1">
                    <a href="index.php?action=editMaintenance&amp;name={name}"><img src="public/manager/images/accept.png"/></a>
                  </xsl:when>
                  <xsl:otherwise>
                    <a href="index.php?action=editMaintenance&amp;name={name}"><img src="public/manager/images/cancel.png"/></a>
                  </xsl:otherwise>
                </xsl:choose>
              </td>
              <td>
                <input type="checkbox" name="actionM[{name}]" value="1"/>
              </td>
            </tr>
          </xsl:for-each>
        </table>
        </form>
        </div>
      </div>
      
      

    </div>
    <xsl:call-template name="displayFooter" />
  </body>
</html>
 </xsl:template>
 </xsl:stylesheet>
